home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / othergnu / gdbm15.zoo / makefile < prev    next >
Encoding:
Makefile  |  1992-09-24  |  5.3 KB  |  188 lines

  1. GVERSION=gversion -v 1.5.0.1
  2. # Makefile for gdbm.
  3. #
  4. # for System V, add "-DSYSV" to CFLAGS.  Also, if you need alloca(),
  5. # add "-lPW" to LIBS.
  6. #
  7. # for BSD, nothing is required
  8. #
  9. # for gcc, uncomment the CC = gcc line.
  10.  
  11. AR = gcc-ar
  12. CC = gcc -v -z -Wall -Ig:/mint/include
  13. LD = gcc -v -z -Wall -Lg:/mint/lib
  14. #CFLAGS = -g # -O -DSYSV
  15. CFLAGS = -O -fomit-frame-pointer
  16. LDFLAGS = -nostdlib g:/mint/lib/crt0.o
  17. #LIBS = # -lPW
  18. LIBS = -lgnu
  19. DBM = -ldbm
  20. NDBM = -lc
  21. LIBC = -lc
  22. LINTFLAGS =
  23.  
  24. DBM_CF = dbminit.c delete.c fetch.c store.c seq.c
  25.  
  26. NDBM_CF = dbmopen.c dbmdelet.c dbmfetch.c dbmstore.c dbmseq.c \
  27.     dbmclose.c dbmdirfn.c dbmpagfn.c
  28.  
  29. GDBM_CF = gdbmopen.c gdbmdele.c gdbmfetc.c  gdbmstor.c gdbmclos.c \
  30.     gdbmreor.c gdbmseq.c \
  31.     bucket.c falloc.c findkey.c global.c hash.c update.c version.c
  32.  
  33. HFILES = gdbmdefs.h extern.h gdbmerrn.h systems.h dbm.h ndbm.h gdbmcons.h
  34.  
  35.  
  36. MSCFILES = COPYING _change.log makefile readme gdbm.pro conv2gdb.c
  37.  
  38. TESTFILES = testdbm.c testndbm.c testgdbm.c
  39.  
  40.  
  41. DBM_OF = dbminit.o delete.o fetch.o store.o seq.o
  42.  
  43. NDBM_OF = dbmopen.o dbmdelet.o dbmfetch.o dbmstore.o dbmseq.o \
  44.     dbmclose.o dbmdirfn.o dbmpagfn.o
  45.  
  46. GDBM_OF = gdbmopen.o gdbmdele.o gdbmfetc.o  gdbmstor.o gdbmclos.o \
  47.     gdbmreor.o gdbmseq.o \
  48.     bucket.o falloc.o findkey.o global.o hash.o update.o version.o
  49.  
  50. # atari/MiNT does not have (or really need) this
  51. OTHER_OF = #fsync.o
  52.  
  53. LIBDIR = /dev/g/mint/lib
  54. INCLUDE = /dev/g/mint/include
  55.  
  56. default:    
  57.     @echo "\"make gdbm.olb\" to make the library"
  58.     @echo "\"make testgdbm\" to make the gdbm test program"
  59.     @echo "\"make testdbm\" to make the dbm compatability test program"
  60.     @echo "\"make testndbm\" to make the ndbm compatability test program"
  61.     @echo "\"make allgdbm\" to make all of the above"
  62.     @echo "\"make tests\" to make the tests progs above"
  63.     @echo "\"make tdbm\" to make the dbm test program (uses dbm, not gdbm)"
  64.     @echo "\"make tndbm\" to make the ndbm test program (uses ndbm)"
  65.     @echo "\"make alldbm\" to make the two previous programs"
  66.     @echo "\"make conv2gdbm\" to make the conversion program"
  67.     @echo "\"make all\" to make all of the above"
  68.     @echo "\"make install\" to install the library"
  69.     @echo "\"make dist\" to make gdbm.tar.Z distribution file"
  70.  
  71. all:    allgdbm conv2gdb alldbm
  72.  
  73. alldbm: tdbm.ttp tndbm.ttp
  74.  
  75. allgdbm: gdbm.olb testgdbm.ttp testdbm.ttp testndbm.ttp
  76.  
  77. tests: testgdbm.ttp testdbm.ttp testndbm.ttp
  78.  
  79. gdbm.olb:    $(DBM_OF) $(NDBM_OF) $(GDBM_OF) $(OTHER_OF) gdbm.h
  80.     rm -f gdbm.olb
  81.     $(AR) rsv gdbm.olb $(DBM_OF) $(NDBM_OF) $(GDBM_OF) $(OTHER_OF)
  82. #    if [ -f /usr/bin/ranlib -o -f /bin/ranlib ]; \
  83. #        then ranlib gdbm.olb; fi
  84.     $(GVERSION) gdbm.olb
  85.  
  86. gdbm.h:    gdbm.pro gdbmerrn.h
  87.     cp gdbm.pro gdbm.h
  88.     chmod +w gdbm.h
  89.     grep _ gdbmerrn.h >> gdbm.h
  90.  
  91. install: gdbm.olb gdbm.h
  92.     install -c -m 644 gdbm.olb $(LIBDIR)/gdbm.olb
  93. #    if [ -f /usr/bin/ranlib -o -f /bin/ranlib ]; \
  94. #        then ranlib $(LIBDIR)/gdbm.olb; fi
  95.     install -c -m 644 gdbm.h $(INCLUDE)/gdbm.h
  96.  
  97. testgdbm.ttp: testgdbm.o gdbm.olb
  98.     $(LD) $(CFLAGS) $(LDFLAGS) -o testgdbm.ttp testgdbm.o gdbm.olb $(LIBS)
  99.  
  100. testdbm.ttp: testdbm.o gdbm.olb
  101.     $(LD) $(CFLAGS) $(LDFLAGS) -o testdbm.ttp testdbm.o gdbm.olb $(LIBS)
  102.  
  103. tdbm.ttp: testdbm.o gdbm.olb
  104.     $(LD) $(CFLAGS) $(LDFLAGS) -o tdbm.ttp testdbm.o $(DBM) $(LIBS)
  105.  
  106. testndbm.o: testndbm.c
  107.     $(CC) -c $(CFLAGS) -DGNU testndbm.c
  108.  
  109. testndbm.ttp: testndbm.o gdbm.olb
  110.     $(LD) $(CFLAGS) $(LDFLAGS) -o testndbm.ttp testndbm.o gdbm.olb $(LIBS)
  111.  
  112. tndbm.o: testndbm.c
  113.     rm -f tndbm.c
  114.     cp testndbm.c tndbm.c
  115.     $(CC) $(CFLAGS) -c tndbm.c
  116.     rm -f tndbm.c
  117.  
  118. tndbm.ttp: tndbm.o gdbm.olb
  119.     $(LD) $(CFLAGS) $(LDFLAGS) -o tndbm.ttp tndbm.o $(LIBS) $(NDBM)
  120.  
  121. conv2gdb: conv2gdbm.o gdbm.olb
  122.     $(LD) $(CFLAGS) $(LDFLAGS) -o conv2gdb.ttp conv2gdb.o $(DBM) $(LIBC) \
  123.     gdbm.olb $(LIBS)
  124.  
  125. lintgdbm: 
  126.     lint $(LFLAGS) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) testgdbm.c
  127.  
  128. clean:
  129.     rm -f $(DBM_OF) $(NDBM_OF) $(GDBM_OF) gdbm.h gdbm.olb \
  130.     testdbm.ttp testndbm.ttp testgdbm.ttp testdbm.o testndbm.o testgdbm.o \
  131.     tdbm.ttp tndbm.ttp tndbm.o tndbm.c conv2gdb conv2gdb.o
  132.  
  133. dist:
  134.     OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/gdbm-\1/p' version.c` \
  135.     ;mkdir $$OF             \
  136.     ;ln $(MSCFILES) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) $(HFILES) \
  137.         $(TESTFILES)  $$OF      \
  138.     ;tar cvohf $$OF.tar $$OF  \
  139.     ;compress $$OF.tar        \
  140.     ;rm -rf $$OF
  141.  
  142.  
  143. # dbm files
  144. dbminit.o:    gdbmdefs.h extern.h gdbmerrno.h
  145. delete.o:    gdbmdefs.h extern.h
  146. fetch.o:    gdbmdefs.h extern.h
  147. store.o:    gdbmdefs.h extern.h
  148. seq.o:        gdbmdefs.h extern.h
  149.  
  150. # ndbm files
  151. dbmopen.o:    gdbmdefs.h extern.h gdbmerrn.h
  152. dbmdelet.o:    gdbmdefs.h extern.h
  153. dbmfetch.o:    gdbmdefs.h extern.h
  154. dbmstore.o:    gdbmdefs.h extern.h
  155. dbmseq.o:    gdbmdefs.h extern.h
  156. dbmclose.o:    gdbmdefs.h systems.h
  157. dbmpagfn.o:    gdbmdefs.h extern.h
  158. dbmdirfn.o:    gdbmdefs.h extern.h
  159.  
  160.  
  161. # gdbm files
  162. gdbmclos.o:    gdbmdefs.h 
  163. gdbmdele.o:    gdbmdefs.h gdbmerrn.h 
  164. gdbmfetc.o:    gdbmdefs.h gdbmerrn.h 
  165. gdbmopen.o:    gdbmdefs.h gdbmerrn.h 
  166. gdbmreor.o:    gdbmdefs.h gdbmerrn.h extern.h
  167. gdbmseq.o:    gdbmdefs.h 
  168. gdbmstor.o:    gdbmdefs.h gdbmerrn.h 
  169.  
  170. # gdbm support files
  171. bucket.o:    gdbmdefs.h
  172. falloc.o:    gdbmdefs.h
  173. findkey.o:    gdbmdefs.h
  174. global.o:    gdbmdefs.h gdbmerrn.h 
  175. hash.o:        gdbmdefs.h
  176. update.o:    gdbmdefs.h
  177. version.o:
  178. extern.h:
  179. gdbmdefs.h:    gdbmcons.h systems.h
  180.     touch gdbmdefs.h
  181.  
  182. # other programs
  183. testgdbm.o:    gdbmdefs.h extern.h gdbmerrno.h systems.h
  184. testdbm.o:
  185. testndbm.o:    ndbm.h
  186. tdbm.o:
  187. conv2gdb.o:    gdbm.h
  188.